package com.validant.enigma3.reports;

import java.util.List;

import org.testng.ITestResult;
import org.uncommons.reportng.ReportNGUtils;

public class ScreenshotReportNGUtils extends ReportNGUtils {
	/* (non-Javadoc)
     * @see org.uncommons.reportng.ReportNGUtils#getTestOutput(org.testng.ITestResult)
     * override to add screenshot from result attribute
     */
    public List<String> getTestOutput(ITestResult result) {
        List<String> output = super.getTestOutput(result);
        String screenshotURL = (String)result.getAttribute("screenshotURL");

        if (screenshotURL != null)
        	output.add("<a href='" + screenshotURL + "'>View Screenshot</a>");
        
        return output;
    }
}
